﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>狼途汽车门店管理平台-登录</title>
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/js/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/js/Ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="/js/adminlte/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/js/adminlte/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="/js/adminlte/css/fonts.googleapis.com.css">

    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.js"></script>
    <script src="/js/adminlte/js/adminlte.min.js"></script>

    <link rel="stylesheet" href="/js/plugins/sweetalert2/sweetalert2.min.css">
    <script src="/js/plugins/sweetalert2/sweetalert2.min.js"></script>


</head>
<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="http://www.wolfcode.cn"><b>狼途</b>汽车门店管理平台</a>
    </div>

    <div class="login-box-body">
        <p class="login-box-msg">请输入账号密码</p>

        <form action="/empLogin" method="post" id="loginForm">
            <div class="form-group has-feedback">
                <input type="text" name="username" class="form-control" placeholder="请输入账号" value="root">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" name="password" class="form-control" placeholder="请输入密码" value="1">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <div class="col-xs-4">
                    <button type="button" class="btn btn-primary btn-block btn-flat submitBtn">登录</button>
                </div>
            </div>
        </form>
        <script>
            $('.submitBtn').click(function () {

                var username = $('input[name=username]').val();
                var password = $('input[name=password]').val();
                $.get('/empLogin', {username: username, password: password}, function (data) {
                    if (data.success) {
                        setTimeout(function () {
                            window.location.href = "/employee/list"
                        }, 1000);

                    }
                    Swal.fire(
                        data.msg
                    );
                })
            })
        </script>
    </div>
</div>


</body>
</html>
